package com.dragon.mmochat.model.deal;

import java.sql.Timestamp;

public class MmochatDealLog implements Comparable<MmochatDealLog>{
	private long id;
	private Timestamp time; // 交易时间
	private int roleId1; // 交易方A
	private String role1Imei; // 交易方A的imei
	private MmochatDealObjs role1DealObjs;// 交易方A交易出去的东西
	private int roleId2; // 交易方B
	private String role2Imei; // 交易方B的imei
	private MmochatDealObjs role2DealObjs;// 交易方B交易出去的东西

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@SuppressWarnings("deprecation")
	public String getDate() {
		return time.toLocaleString();
	}

	public Timestamp getTime() {
		return time;
	}

	public void setTime(Timestamp time) {
		this.time = time;
	}

	public int getRoleId1() {
		return roleId1;
	}

	public void setRoleId1(int roleId1) {
		this.roleId1 = roleId1;
	}

	public MmochatDealObjs getRole1DealObjs() {
		return role1DealObjs;
	}

	public void setRole1DealObjs(MmochatDealObjs role1DealObjs) {
		this.role1DealObjs = role1DealObjs;
	}

	public int getRoleId2() {
		return roleId2;
	}

	public void setRoleId2(int roleId2) {
		this.roleId2 = roleId2;
	}

	public MmochatDealObjs getRole2DealObjs() {
		return role2DealObjs;
	}

	public void setRole2DealObjs(MmochatDealObjs role2DealObjs) {
		this.role2DealObjs = role2DealObjs;
	}

	public String getRole1Imei() {
		return role1Imei;
	}

	public void setRole1Imei(String role1Imei) {
		this.role1Imei = role1Imei;
	}

	public String getRole2Imei() {
		return role2Imei;
	}

	public void setRole2Imei(String role2Imei) {
		this.role2Imei = role2Imei;
	}

	@Override
	public int compareTo(MmochatDealLog o) {
		return (int)(o.getTime().getTime() - time.getTime());
	}

}
